package kit.edu.lego.gruppe3.levels.bridge;

import kit.edu.lego.gruppe3.ComponentsRepository;
import kit.edu.lego.gruppe3.levels.LevelSelector;
import lejos.nxt.LCD;
import lejos.robotics.navigation.DifferentialPilot;
import lejos.robotics.subsumption.Behavior;

/**
 * Normal forward movement for the robot is with a 15 degree steering to the right
 * @author Lac
 *
 */
public class MoveOnRightSide implements Behavior
{



	@Override
	public void action()
	{
		LCD.drawString("B: Move right", 0, 1);
		
		DifferentialPilot robot = ComponentsRepository.getInstance().getRobotPilot();
		robot.setTravelSpeed(5);
		robot.steer(-15);
		
	}

	@Override
	public void suppress()
	{

	}

	@Override
	public boolean takeControl()
	{
		LCD.drawString("Light: "+ComponentsRepository.getInstance().getLightSensor().getLightValue(), 0, 2);
		LCD.drawString("Distance: "+ComponentsRepository.getInstance().getSonicSensor().getDistance(), 0, 3);

		return LevelSelector.getInstance().isBridge();
	}

}
